<?php
namespace lib;

use lib\src\route;
use lib\src\config;
use lib\src\debug;
use lib\src\iException;

class app{
	/**
	 * start
	 */
	public function __construct(){
		//注册异常机制
		iException::register();
		//加载基本配置
		
	}
	/**
	 * run
	 */
	public static function run(){
		$conArr = route::useCont();
		$action = $conArr[0];
		$method = $conArr[1];
		$pathLoad = config::getConfig("app_path");
		$path = $pathLoad.$action.".php";
		//check
		self::pathCheck($path);
		require $path;
		$controller = new $action;
		//check
		self::methodCheck($controller, $method);
		//run
		$controller->$method();
	}
}
?>